<template>
    <div class="courseDesignDetails">
      <mt-header v-bind:title="courseDetailsForm.courseNameCN">
        <router-link to="" slot="left">
          <mt-button icon="back" @click="backOne()">返回</mt-button>
        </router-link>
        <!--<mt-button icon="more" slot="right"></mt-button>-->
      </mt-header>

      <form v-modal="courseDetailsForm">
        <mt-field label="课程名称" placeholder="" readonly="readonly" v-model="courseDetailsForm.courseNameCN"></mt-field>
        <mt-field label="负责教师" placeholder="" readonly="readonly" v-model="courseDetailsForm.teacherName"></mt-field>
        <mt-field label="所带班级" placeholder="" readonly="readonly" v-model="courseDetailsForm.className"></mt-field>
        <mt-field label="开始时间" placeholder="" readonly="readonly" v-model="courseDetailsForm.startTime"></mt-field>
        <mt-field label="结束时间" placeholder="" readonly="readonly" v-model="courseDetailsForm.endTime"></mt-field>
        <mt-field label="上传人" placeholder="" readonly="readonly" v-model="courseDetailsForm.username"></mt-field>
        <mt-field label="课程设计安排" placeholder="" readonly="readonly" v-model="courseDetailsForm.courseArrangeInfoName">
          <mt-button type="primary" size="small" >下载</mt-button>
        </mt-field>
        <mt-field label="课程设计内容" placeholder="" readonly="readonly" v-model="courseDetailsForm.courseDesignInfoName">
          <mt-button type="primary" size="small" >下载</mt-button>
        </mt-field>
        <router-link to="/CourseDataSubmit" tag="mt-button" class="mint-button mint-button--primary mint-button--small" style="margin-left:10px;">查看课程设计资料提交情况</router-link>
      </form>

<!--      <button @click="backOne">123</button>-->

    </div>
</template>
<style>
</style>
<script>
    export default{
        name : 'courseDesignDetails',
        data(){
            return{
                theId:'',
                courseDetailsForm:{}
            }
        },
        components:{
        },
        mounted:function(){
            this.$nextTick(function(){
                this.theId = this.$route.params.courseDesignID;
                this.getAll(this.theId);
            })
        },
        methods:{
            //router back
            backOne:function(){
                this.$router.back();
            },
            //get all of graduate id
            getAll:function(elementID){
                this.$http.post('http://localhost:8080/TeachingMIS/courseDesign/getOneDesignInfo?courseDesignID=' + elementID).then(response => {
                    console.log(response.body[0]);
                    this.courseDetailsForm = response.body[0];
                },response => {
                    alert("找不到文件");
                });
            }
        }
    }
</script>
